<template>
  <div class="detail box">
    <div class="left">
      <div class="info-list">
        <div
          class="info-item"
          v-for="(item, index) in infoList"
          :key="index"
          :class="{ active: position === item.value }"
          @click="infoItemClick(item, index)"
        >
          {{ item.label }}
        </div>
      </div>
    </div>
    <div class="right">
      <div v-if="position === '1'">
        <ContactSheet></ContactSheet>
      </div>
      <div v-if="position === '2'" style="height: 100%;">
        <RelationInquire></RelationInquire>
      </div>
      <div v-if="position === '3'">
        <AllocationMove></AllocationMove>
      </div>
      <div v-if="position === '4'">
        <AffiliationHistory></AffiliationHistory>
      </div>
    </div>
  </div>
</template>

<script>
import AffiliationHistory from './components/AffiliationHistory.vue';
import AllocationMove from './components/AllocationMove.vue';
import ContactSheet from './components/ContactSheet.vue';
import RelationInquire from './components/RelationInquire.vue';
export default {
  name: "platform",
  components: {
    AffiliationHistory,
    AllocationMove,
    ContactSheet,
    RelationInquire,
  },
  data() {
    return {
      position: "1",
      infoList: [
        {
          label: "客户经理联系表",
          value: "1",
          isActive: false,
        },
        {
          label: "客户关系查询",
          value: "2",
          isActive: false,
        },
        {
          label: "客户分配移交",
          value: "3",
          isActive: false,
        },
        {
          label: "归属历史",
          value: "4",
          isActive: false,
        },
      ],
    };
  },
  watch: {
    $route: {
      immediate: true,
      handler(value) {
      },
    },
  },
  mounted() {
  },

  methods: {
    infoItemClick(item, index) {
      this.position = item.value;
    },
  },
};
</script>

<style lang="scss" scoped>
.detail {
  display: flex;
  color: #fff;
  .left {
    width: 200px;
    background-color: #262d47;
    height: 100%;
    .info-list {
      padding: 10px 0;
      .info-item {
        margin-bottom: 2px;
        height: 40px;
        line-height: 40px;
        text-align: center;
        // background-color: #363657;
        color: #959fc5;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        &:hover {
          background-color: #1c2238 !important;
          color: #fff;
          cursor: pointer;
        }
      }
      .active {
        background-color: #1c2238 !important;
        color: #fff;
        position: relative;
        // border-right:4px solid #1F9BFD ;
        &:after{
          content: '';
          display:inline-block;
          width: 4px;
          height: 100%;
          background: #1F9BFD;
          position: absolute;
          right: 0;
        }
      }
    }
  }
  .right {
    flex: 1;
    background-color: #262d47;
    height: 100%;
    margin-left: 10px;
  }
}
</style>
